﻿<?php

function drawHeader()
{
  
  echo "<tr>";
      echo "<td></td><td></td><td></td><td></td>";
  echo "</tr>";
  echo "<tr>";
      echo "<td></td>";
      echo "<th colspan = \"1\" align = \"left\"><font size = \"10\" color = \"green\">";
        echo "<meta charset =\"utf-8\"><a href = index.php?type=1>ЧАТИК</a></meta></font>";
		  
		  echo "</th>";
		  echo "<td align = \"right\">";
		  echo "Добро пожаловать, ";
		  if (isset($_SESSION['loggedIn']) && $_SESSION['loggedIn'])
		  {			
			echo $_SESSION['name'];	
			echo "!";	
		  } else {
			echo "Гость! Вы не авторизованы.";
		  }
		  
		   echo "</td>";
			echo "<td align = \"right\">";
		  if (!$_SESSION['loggedIn'])
		  {
			echo "<a href = auth.php>Авторизация<Br>";
			echo "<a href = registr.php>Регистрация<Br>";
		  }
		  
		  if ($_SESSION['loggedIn'])
		  {
			//echo "HELLO";
			echo "<a href = exit.php>Выход";
		  }
     
  echo "</tr>";
  echo "<tr  cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"green\"><th colspan = \"4\">&nbsp;</th></tr>";
  echo "<tr  cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"white\"><th colspan = \"4\">&nbsp;</th></tr>";
}



?>

